package com.vencent.struts;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.vencent.struts.domian.User;

public class Demo4 extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String execute() throws Exception {
		ActionContext.getContext().put("list", new String[] {"1", "2", "3"} );
		return super.execute();
	}
	
	public String executeObject() throws Exception {
		List<User> list = new ArrayList<>();
		list.add(new User(10L, "Wang"));
		list.add(new User(11L, "Lee"));
		list.add(new User(12L, "Zhao"));
		ActionContext.getContext().put("listObject", list);
		return super.execute();
	}
}
